// Copyright (c) Appeon. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

using System;
using System.Collections.Generic;

namespace SnapObjects.Data.Sqlite
{
    public class SqliteSqlKeywords : SqlKeywords
    {
        private static readonly IDictionary<string, SqlKeywords> _sqlmembers
            = new Dictionary<string, SqlKeywords>(
                _members, StringComparer.OrdinalIgnoreCase);

        protected SqliteSqlKeywords(string name) : base(name)
        {

        }

        protected override void Register(string name)
        {
            if (!_sqlmembers.ContainsKey(name))
            {
                _sqlmembers.Add(name, this);
            }

            _name = name;
        }

        public static new bool IsKeyword(string value)
        {
            return _sqlmembers.ContainsKey(value);
        }

        public static new SqlKeywords Parse(string value)
        {
            if (_sqlmembers.ContainsKey(value))
            {
                return _sqlmembers[value];
            }

            return NOTHING;
        }

        public static readonly SqliteSqlKeywords ABORT = new SqliteSqlKeywords("ABORT");
        public static readonly SqliteSqlKeywords AFTER = new SqliteSqlKeywords("AFTER");
        public static readonly SqliteSqlKeywords ANALYZE = new SqliteSqlKeywords("ANALYZE");
        public static readonly SqliteSqlKeywords ATTACH = new SqliteSqlKeywords("ATTACH");
        public static readonly SqliteSqlKeywords AUTOINCREMENT = new SqliteSqlKeywords("AUTOINCREMENT");

        public static readonly SqliteSqlKeywords BEFORE = new SqliteSqlKeywords("BEFORE");

        public static readonly SqliteSqlKeywords CONFLICT = new SqliteSqlKeywords("CONFLICT");

        public static readonly SqliteSqlKeywords DATABASE = new SqliteSqlKeywords("DATABASE");
        public static readonly SqliteSqlKeywords DETACH = new SqliteSqlKeywords("DETACH");
        public static readonly SqliteSqlKeywords DO = new SqliteSqlKeywords("DO");

        public static readonly SqliteSqlKeywords EACH = new SqliteSqlKeywords("EACH");
        public static readonly SqliteSqlKeywords EXCLUDE = new SqliteSqlKeywords("EXCLUDE");
        public static readonly SqliteSqlKeywords EXCLUSIVE = new SqliteSqlKeywords("EXCLUSIVE");
        public static readonly SqliteSqlKeywords EXPLAIN = new SqliteSqlKeywords("EXPLAIN");

        public static readonly SqliteSqlKeywords FAIL = new SqliteSqlKeywords("FAIL");
        public static readonly SqliteSqlKeywords FILTER = new SqliteSqlKeywords("FILTER");
        public static readonly SqliteSqlKeywords FOLLOWING = new SqliteSqlKeywords("FOLLOWING");

        public static readonly SqliteSqlKeywords GLOB = new SqliteSqlKeywords("GLOB");
        public static readonly SqliteSqlKeywords GROUPS = new SqliteSqlKeywords("GROUPS");

        public static readonly SqliteSqlKeywords IF = new SqliteSqlKeywords("IF");
        public static readonly SqliteSqlKeywords IGNORE = new SqliteSqlKeywords("IGNORE");
        public static readonly SqliteSqlKeywords INDEXED = new SqliteSqlKeywords("INDEXED");
        public static readonly SqliteSqlKeywords INSTEAD = new SqliteSqlKeywords("INSTEAD");
        public static readonly SqliteSqlKeywords ISNULL = new SqliteSqlKeywords("ISNULL");

        public static readonly SqliteSqlKeywords LIMIT = new SqliteSqlKeywords("LIMIT");

        public static readonly SqliteSqlKeywords NOTNULL = new SqliteSqlKeywords("NOTNULL");

        public static readonly SqliteSqlKeywords OFFSET = new SqliteSqlKeywords("OFFSET");
        public static readonly SqliteSqlKeywords OTHERS = new SqliteSqlKeywords("OTHERS");
        public static readonly SqliteSqlKeywords OVER = new SqliteSqlKeywords("OVER");

        public static readonly SqliteSqlKeywords PARTITION = new SqliteSqlKeywords("PARTITION");
        public static readonly SqliteSqlKeywords PLAN = new SqliteSqlKeywords("PLAN");
        public static readonly SqliteSqlKeywords PRAGMA = new SqliteSqlKeywords("PRAGMA");
        public static readonly SqliteSqlKeywords PRECEDING = new SqliteSqlKeywords("PRECEDING");

        public static readonly SqliteSqlKeywords QUERY = new SqliteSqlKeywords("QUERY");

        public static readonly SqliteSqlKeywords RAISE = new SqliteSqlKeywords("RAISE");
        public static readonly SqliteSqlKeywords RANGE = new SqliteSqlKeywords("RANGE");

        public static readonly SqliteSqlKeywords RECURSIVE = new SqliteSqlKeywords("RECURSIVE");
        public static readonly SqliteSqlKeywords REGEXP = new SqliteSqlKeywords("REGEXP");
        public static readonly SqliteSqlKeywords REINDEX = new SqliteSqlKeywords("REINDEX");
        public static readonly SqliteSqlKeywords RELEASE = new SqliteSqlKeywords("RELEASE");
        public static readonly SqliteSqlKeywords RENAME = new SqliteSqlKeywords("RENAME");
        public static readonly SqliteSqlKeywords REPLACE = new SqliteSqlKeywords("REPLACE");
        public static readonly SqliteSqlKeywords ROW = new SqliteSqlKeywords("ROW");

        public static readonly SqliteSqlKeywords SAVEPOINT = new SqliteSqlKeywords("SAVEPOINT");

        public static readonly SqliteSqlKeywords TEMP = new SqliteSqlKeywords("TEMP");
        public static readonly SqliteSqlKeywords TIES = new SqliteSqlKeywords("TIES");
        public static readonly SqliteSqlKeywords TRIGGER = new SqliteSqlKeywords("TRIGGER");

        public static readonly SqliteSqlKeywords UNBOUNDED = new SqliteSqlKeywords("UNBOUNDED");

        public static readonly SqliteSqlKeywords VACUUM = new SqliteSqlKeywords("VACUUM");
        public static readonly SqliteSqlKeywords VIRTUAL = new SqliteSqlKeywords("VIRTUAL");

        public static readonly SqliteSqlKeywords WINDOW = new SqliteSqlKeywords("WINDOW");
        public static readonly SqliteSqlKeywords WITHOUT = new SqliteSqlKeywords("WITHOUT");
    }
}
